Show AllShow All

TwoColorGradient Method

Sets the specified fill to a two-color gradient.

expression.TwoColorGradient(Style, Variant)

expression    Required. An expression that returns one of the objects in the Applies To list.

Style   Required MsoGradientStyle. Specifies the gradient style.

Variant    Required Long. Specifies the gradient variant. Can be a value from 1 through 4, corresponding to the four variants on the Gradient tab in the Fill Effects dialog box. If Style is msoGradientFromCenter, the Variant argument can only be either 1 or 2.

Example

This example sets the gradient, background color, and foreground color for the chart area fill on the chart.

With myChart.ChartArea.Fill
    .Visible = True
    .ForeColor.SchemeColor = 15
    .BackColor.SchemeColor = 17
    .TwoColorGradient msoGradientHorizontal, 1
End With